<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script type="text/javascript">

    function Person() {
    }
    Person.prototype.name = '悟空'
    Person.prototype.age = '500'
    Person.prototype.gender = '男'
    Person.prototype.sayName = function () {
        console.log(this.name)
    }
    var person1 = new Person()
    var person2 = new Person()
    person1.name = '唐僧'
    // console.log('name' in person1)  // true
    // console.log('name' in person2)  // true

    var keys = Object.keys(Person.prototype)
    console.log(keys)
    for (let i = 0; i < keys.length; i++) {
        console.log(Person.prototype[keys[i]])
    }


</script>

</body>
</html>
